/*
 * TransitStubPanel.java
 *
 * 
 */

package it.luigiarpino.alt2jsim.netpanel;

import it.luigiarpino.alt2jsim.core.Grafo;
import it.luigiarpino.alt2jsim.netpanel.flat.NetPanel;
import it.luigiarpino.alt2jsim.netpanel.flat.TextPanel;
import it.luigiarpino.alt2jsim.netpanel.flat.ZoomPanel;
import it.luigiarpino.alt2jsim.netpanel.transit.SingleTransitNetPanel;
import it.luigiarpino.alt2jsim.netpanel.transit.StubNetPanel;
import it.luigiarpino.alt2jsim.network.TransitStubNet;
import javax.swing.*;
import java.awt.*;


/**
 *
 * @author  Luigi Lorenzo Arpino 534/559
 */
public class TransitStubPanel extends JPanel{
    
    /**
	 * 
	 */
	private static final long serialVersionUID = 4236191992198646688L;
	private JTabbedPane jTabbedPane;
    
    /**Pannello usato come contenitore per tutte le visualizzazioni
     relative alle reti di tipo transit-Stub*/
    public TransitStubPanel(Grafo grafo_) {
        super();
        try{ 
            javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
    	} 
    	catch(Exception e) { }
        TransitStubNet net_=(TransitStubNet)grafo_.getNet();
        this.jTabbedPane=new JTabbedPane();
        this.jTabbedPane.addTab("Transit networks",new NetPanel(net_.getTransitMatrix(),"Netwok",net_.getTransitName(),NetPanel.TRANSIT_NET)); 
        this.jTabbedPane.addTab("Zoom transit network",new SingleTransitNetPanel(net_));
        this.jTabbedPane.addTab("Stub networks",new StubNetPanel(net_));
        this.jTabbedPane.addTab("Zoom view",new ZoomPanel(net_));
        JPanel pannello=new JPanel(new BorderLayout());
        JLabel label=new JLabel(net_.getInfo());
        label.setFont(new Font(null,Font.PLAIN,20));
        pannello.add(label,BorderLayout.CENTER);
        this.jTabbedPane.addTab("Network information",pannello);
        this.jTabbedPane.addTab("Show translation",new TextPanel(grafo_));
        this.setLayout(new BorderLayout());
        this.add(this.jTabbedPane, BorderLayout.CENTER);
    }
    
}
